package monitoring.application;

import hifiSpeakers.TextBasedHifiLoud;
import hifiSpeakers.TextBasedHifiMedium;
import hifiSpeakers.TextBasedHifiQuiet;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;

import monitoring.UssProjectView;

/*
 * Author : Mohamed Delhomme
 */

public class StartHifiAction extends AbstractAction {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private UssProjectView monitor;
	private String type;

	public StartHifiAction(UssProjectView monitor, String type, String texte) {
		super(texte);

		this.monitor = monitor;
		this.type = type;
	}

	public void actionPerformed(ActionEvent e) {
		if (type == "LOUD") {
			monitor.hifiType = "LOUD";
			monitor.hifiLoud.begin();
		}
		else if (type == "MEDIUM") {
			monitor.hifiType = "MEDIUM";
			monitor.hifiMedium.begin();
		}
		else if (type == "QUIET") {
			monitor.hifiType = "QUIET";
			monitor.hifiQuiet.begin();
		}
	}
}
